<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@ include file="/WEB-INF/view/jQgrid.jsp"%>
<link type="text/css" rel="stylesheet" href="<%=contextPath %>/static/bootstrap-fileinput/css/fileinput.css" />
<script type="text/javascript" src="<%=contextPath %>/static/bootstrap-fileinput/js/fileinput.js"></script>
<script type="text/javascript" src="<%=contextPath %>/static/bootstrap-fileinput/js/locales/zh.js"></script>
<script type="text/javascript" src="<%=contextPath %>/plugins/zTree_v3/js/jquery.ztree.core.min.js"></script>
<script type="text/javascript" src="<%=contextPath %>/plugins/zTree_v3/js/jquery.ztree.excheck.min.js"></script>
</head>
<body>
	<div class="container-fluid" id="main-container">
		<div id="page-content" class="clearfix">
			<div class="row-fluid">
			<div class="col-sm-10">
				<div class="form-group" style="text-align: right;margin-top: 15px;">
				    <a class="btn btn-info" onclick="resumelist();">返回列表</a>
				</div>
			</div>
				<div class="col-sm-10">
					<form class="form-horizontal" id="signupForm" role="form" method="post" enctype="multipart/form-data">
					<input type="hidden" name="id" id="id"  value="${resume.id }" />
						<fieldset>
							<legend>基本资料</legend>
							<div class="form-group">
								<!-- Select Basic -->
								<label class="col-sm-2 control-label">类型：</label>
								<div class="col-sm-4">
									<select class="form-control" name="type">
										<c:forEach items="${fns:getDictList('resume_type')}"
											var="temp1">
											<option value="${temp1.value }"<c:if test="${temp1.value eq resume.type }">selected="selected"</c:if>>${temp1.valueName }</option>
										</c:forEach>
									</select>
								</div>
								<label class="col-sm-2 control-label">行业：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="industryName"
										onclick="openTree('industry');" placeholder="请选择行业"
										readonly="readonly"  name="industryNames" value="${resume.industryNames}"/> <input type="hidden" name="industryId"
										id="industryId" value="${resume.industryId }"/>
									<p class="help-block">最多可选三个行业，多选无效。</p>
								</div>
							</div>
							<div class="form-group">
							    <label class="col-sm-2 control-label">真实姓名：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="name" name="trueName" value="${resume.trueName }"/>
									<p class="help-block" style="color: red;">*必填项，姓名具有唯一性，不可重复添加，如姓名存在请联系管理员。</p>
								</div>
								<label class="col-sm-2 control-label">手机号码：</label>
								<div class="col-sm-4 form-inline" id="phoneinput">
								 <input type="tel" class="form-control" id="cellphone"
										name="cellphone" value="${resume.cellphone }"  maxlength="11" placeholder="请输入工作号码" />
								 <p class="help-block" style="color: red;">*必填项，请输入手机号码，如手机号存在请联系管理员。</p>
								 <input type="tel" class="form-control" id="lifephone"
										name="lifephone" value="${resume.lifephone }"  maxlength="11"  placeholder="生活号码非必填项" onblur="isPhone('lifephone',this.value)"/>	
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">性别：</label>
								<div class="col-sm-4">
									<label class="radio-inline"> <input value="1"
										 name="sex" type="radio" <c:if test="${resume.sex eq 1 }">checked="checked"</c:if>> 男
									</label> <label class="radio-inline"> <input value="2"
										name="sex" type="radio" <c:if test="${resume.sex eq 2 }">checked="checked"</c:if>> 女
									</label>
									<p class="help-block" style="color: red;">*必填项，请输入性别。</p>
								</div>
								<label class="col-sm-2 control-label">婚姻状况：</label>
								<div class="col-sm-4 form-inline">
									<select class="form-control" name="conditions" id="conditions">
										<c:forEach items="${fns:getDictList('resume_conditions')}"
											var="temp" varStatus="vs">
											<option value="${temp.value }" <c:if test="${temp.value eq resume.conditions}"> selected="selected"</c:if>>${temp.valueName }</option>
										</c:forEach>
									</select>
									<input type="text" class="form-control" id="maritalOther"  style="display: none;"
										name="maritalOther"  placeholder="请输入其他婚姻状况" value="${resume.maritalOther }"/>
									<label class="radio-inline"> <input type="checkbox" name="isSecret" value="1">保密
									</label>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">出生日期：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="birthdate"
										name="birthdate" readonly="readonly" placeholder="请选择日期" value="${resume.birthdate }" onClick="WdatePicker()"/>
									<p class="help-block" style="color: red;">*必填项，请输入出生日期。</p>
								</div>
								<label class="col-sm-2 control-label">身份证号：</label>
								<div class="col-sm-4">
									<input type="number"  id="idCard" name="idCard" class="form-control" value="${resume.idCard }" onblur="isIdCard('idCard',this.value)" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">身高：</label>
								<div class="col-sm-4 form-inline">
									<input type="text" class="form-control" id="stature" name="stature" onblur="isInteger('stature',this.value)" value="${resume.stature }" />（	cm）
								</div>
								<label class="col-sm-2 control-label">体重：</label>
								<div class="col-sm-4 form-inline"> 
									<input type="text" class="form-control" id="weight" name="weight" onblur="isInteger('weight',this.value)" value="${resume.weight }"/>（kg）
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">民族：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="ethnic" name="ethnic" value="${resume.ethnic }" />
								</div>
								<label class="col-sm-2 control-label">健康状况：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="health" name="health" value="${resume.health }"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">邮箱：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="email" name="email"
										value="${resume.email }" onblur="isEmail('email',this.value)"/>
									<p class="help-block" style="color: red;">*必填项，请输入邮箱。</p>
								</div>
								<label class="col-sm-2 control-label">QQ：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="qq" name="qq" value="${resume.qq }"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">微信：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="wechat"
										name="wechat" value="${resume.wechat }" />
								</div>
								<label class="col-sm-2 control-label">领英：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="linkedin" name="linkedin" value="${resume.linkedin }"/>
								</div>
							</div>
							<div class="form-group">
							    <label class="col-sm-2 control-label">国籍：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="nationality"
										name="nationality" value="${resume.nationality }" />
								</div>
								<label class="col-sm-2 control-label">籍贯：</label>
								<div class="col-sm-4">
								    <select  id="province" name="natives" class="selectpicker show-tick form-control"  data-live-search="true"></select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">户口所在地：</label>
								<div class="col-sm-4 form-inline">
								    <p class="help-block">${resume.householdArea.treeNames }</p>
									<select  id="prov"  class="form-control"  style="width:40%;"></select>
									<select  id="city" name="household" class="form-control"  style="width:50%;display:none;" ></select>
								</div>
								<label class="col-sm-2 control-label">目前居住城市：</label>
								<div class="col-sm-4 form-inline">
								<p class="help-block">${resume.locationArea.treeNames }</p>
								<select  id="provnow"  class="form-control"  style="width:40%;"></select>
								<select  id="citynow" name="location" class="form-control"  style="width:50%;display:none;" ></select>
								<p class="help-block" style="color: red;">*必填项，请输入目前居住城市。</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">期望工作城市：</label>
								<div class="col-sm-4">
								      <input type="text" class="form-control" id="areaName"
										onclick="openTree('area');" placeholder="请选择区域"
										readonly="readonly"  name="expectedCityNames" value="${resume.expectedCityNames }"/>
									  <input type="hidden" name="expectedCity" id="areaId" value="${resume.expectedCity }"/>
									  <p class="help-block" style="color: red;">*必填项，最多可选三个城市，多选无效。</p>
								</div>
								<label class="col-sm-2 control-label">目前岗位：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="position" name="position" value="${resume.position }" />
									<p class="help-block" style="color: red;">*必填项，请输入目前岗位名称。</p>
								</div>
							</div>
							<div class="form-group">
								<!-- Select Basic -->
								<label class="col-sm-2 control-label">目前年薪：</label>
								<div class="col-sm-4 form-inline">
									<input type="text" class="form-control" id="emolument"
										name="emolument"  onblur="isIntDec('emolument',this.value);" value="${resume.emolument }"/>（万人民币）
										<p class="help-block" style="color: red;">*必填项，请输入目前年薪。</p>
										<input type="text" class="form-control" id="basicSalary"
										name="basicSalary"  onblur="isIntDec('basicSalary',this.value);" placeholder="请输入基本年薪" value="${resume.basicSalary }"/>（万人民币）
										<p class="help-block" >请输入基本年薪。</p>	
										<input type="text" class="form-control" id="bonus"
										name="bonus"  onblur="isIntDec('bonus',this.value);" placeholder="请输入奖金" value="${resume.bonus }"/>（万人民币）
										<p class="help-block" >请输入奖金。</p>	
										<input type="text" class="form-control" id="equity"
										name="equity" placeholder="请输入股权/期权" value="${resume.equity }"/>
										<p class="help-block" >请输入股权/期权。</p>	
								</div>
								<label class="col-sm-2 control-label">期望年薪：</label>
								<div class="col-sm-4 form-inline">
									<input type="text" class="form-control" id="expectSalarystart"
										name="expectSalarystart" onblur="isIntDec('expectSalarystart',this.value);" value="${resume.expectSalarystart }" /> 
										<p class="help-block" >--至--</p>	
									<input type="text"
										class="form-control" id="expectSalaryend" name="expectSalaryend"
										 onblur="isIntDec('expectSalaryend',this.value);" value="${resume.expectSalaryend }" />（万人民币）
									<p class="help-block" style="color: red;">*必填项，请输入期望年薪。</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">第一学历：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="education"
										name="education" value="${resume.education }" />
									<p class="help-block" style="color: red;">*必填项，请输入第一学历。</p>
								</div>
								<label class="col-sm-2 control-label">专业：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="profession"
										name="profession" value="${resume.profession }"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">最高学历：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="highestEdu"
										name="highestEdu" value="${resume.highestEdu }" />
									<!-- <p class="help-block" style="color: red;">*必填项，请输入第一学历。</p> -->
								</div>
								<label class="col-sm-2 control-label">专业(最高学历)：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="highestPro"
										name="highestPro" value="${resume.highestPro }"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">目前状态</label>
								<div class="col-sm-4">
								    <select class="form-control" name="status">
								        <c:forEach items="${fns:getDictList('resume_status')}"
											var="temp" varStatus="vs">
											<option value="${temp.value }"<c:if test="${temp.value eq resume.status}"> selected="selected"</c:if>>${temp.valueName }</option>
										</c:forEach>
									</select>
								</div>
								<label class="col-sm-2 control-label">标签：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="tagName" name="tag"
										placeholder="请选择标签" readonly="readonly"
										onclick="openTree('tag')"  value="${resume.tag }"/> <input type="hidden"
										class="form-control" id="tagId" name="tagIds" value="${resume.tagIds }"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">自我评价：</label>
								<div class="col-sm-4">
									<textarea rows="3" cols="2" class="form-control" id="advantage"
										name="advantage" >${resume.advantage }</textarea>
								</div>
								<label class="col-sm-2 control-label">备注：</label>
								<div class="col-sm-4">
								 <textarea rows="3" cols="2" class="form-control" id="remark"
										name="remark" >${resume.remark }</textarea>
								 <p class="help-block">填写内容如不看哪些公司，哪些区域，哪些老板</p>
								</div>
							</div>
							<div class="form-group">
								<%-- <label class="col-sm-2 control-label">资格证书：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" id="signature"
										name="signature"  value="${resume.signature }" />
								</div> --%>
								<label class="col-sm-2 control-label">工作语言：</label>
								<div class="col-sm-4 form-inline">
								<input type="text" class="form-control" id="languageName"
										onclick="openTree('language');" placeholder="请选择语言"
										readonly="readonly"  name="language" value="${resume.language }" />
										<input type="hidden" name="languageids" id="languageId" value="${resume.languageids }"  />
										<p class="help-block">最多可选三个语言，多选无效。</p>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">证件照：</label>
								<div class="col-sm-4">
									<input type="file" name="file" id="headPic"/>
									<input type="hidden" id="headPic1" name="headPic" value="${resume.headPic}"/>
									<img alt="" src="<%=contextPath %>/${resume.headPic}"  width="150" height="150">
								</div>
								<label class="col-sm-2 control-label">生活照：</label>
								<div class="col-sm-4">
									<input type="file" name="file"  id="lifePhoto"/>
									<input type="hidden" name="lifePhoto" id="lifePhoto1" value="${resume.lifePhoto}"/>
									<img alt="" src="<%=contextPath %>/${resume.lifePhoto}"  width="150" height="150">
								</div>
							</div>
						</fieldset>
						<fieldset>
							<legend>附属资料</legend>
							<div class="form-group">
								<label class="col-sm-2 control-label">工作经历：</label>
								<div class="col-sm-10 form-inline">
									<button type="button" class="btn btn-info"
										onclick="addExperience('work');">增加</button>
										<input type="text" id="workName"  class="form-control" readonly="readonly" style="width100%;display: none;"/>
										<input type="hidden" id="workId"  name="workExp.id" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">教育经历：</label>
								<div class="col-sm-10 form-inline">
									<button type="button" class="btn btn-info"
										onclick="addExperience('edu',1);">增加</button>
									<input type="text" id="edu1Name" class="form-control"  readonly="readonly" style="width100%;display: none;"/>
									<input type="hidden" id="edu1Id"  name="workExp.id" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">培训经历：</label>
								<div class="col-sm-10 form-inline">
									<button type="button" class="btn btn-info"
										onclick="addExperience('edu',2);">增加</button>
									<input type="text" id="edu2Name" class="form-control"  readonly="readonly" style="width100%;display: none;"/>
									<input type="hidden" id="edu2Id"  name="workExp.id" />
								</div>
							</div>
							<s:hasPermission name="talentsRecommend:add">
							<div class="form-group">
								<label class="col-sm-2 control-label">沟通记录：</label>
								<div class="col-sm-10 form-inline">
									<button type="button" class="btn btn-info"
										onclick="addExperience('demandCommunicate');">增加</button>
								</div>
							</div>
							</s:hasPermission>
						</fieldset>
						<div class="form-group" style="text-align: center;">
							<div class="col-sm-12">
								<button class="btn btn-primary" type="button" id="sub">提交</button>
							</div>
						</div>
					</form>
				</div>
				<!-- PAGE CONTENT ENDS HERE -->

			</div>
			<!--/row-->
		</div>
		<!--/#page-content-->
	</div>
	<!--/.fluid-container#main-container-->
<script type="text/javascript">
var name =$("#name").val();
var phone =$("#cellphone").val();
$(function () {
	initFileInput("headPic");
	initFileInput("lifePhoto");
    $(".form_datetime").datetimepicker({
    	autoclose: true,
        minView: "month", //选择日期后，不会再跳转去选择时分秒
        language: 'zh-CN',
        format: "yyyy-mm-dd",
        forceParse: 0,
        pickTime: false,
        pickerPosition: "bottom-right",
        startDate:"1980-01-01",
        //initialDate:now,
        onSelect: function (dateText, inst) {
            // 不做任何处理
        }
    });
    var condition = '${resume.conditions}';
    if(condition==4){
    	$("#maritalOther").show();
    }
    $("#conditions").change(function(){
    	var id = $(this).val();
    	console.log(id);
    	if(id==4){
    		$("#maritalOther").show();
    	}else {
    		$("#maritalOther").hide();
		}
    });
    $("#sub").click(function () {
    	//批量验证表单非空
    	//调用方式
    	var arr=new Array(
 			  new Array('type','类型未选择!'),
 	    	  new Array('industryName','行业未选择!'),
 	    	  //new Array('name','昵称未填写!'),
 	    	  new Array('name','真实姓名未填写!'),
 	    	  /* new Array('ethnic','民族未填写!'), */
 	    	  new Array('health','健康状况未填写!'),
 	    	  /* new Array('stature','身高未填写!'), */
 	    	  /* new Array('weight','体重未填写!'), */
 	    	  new Array('natives','籍贯未填写!'),
 	    	  new Array('household','户口所在地未填写!'),
 	    	  new Array('birthdate','出生日期未填写!'),
 	    	  new Array('sex','性别未选择!'),
 	    	  /* new Array('signature','资格证书未填写!'), */
 	    	  new Array('position','目前岗位未填写!'),
 	    	  new Array('conditions','婚姻状况未选择!'),
 	    	  new Array('education','学历未填写!'),
 	    	  new Array('emolument','目前年薪未填写!'),
 	    	  new Array('expectSalarystart','期望年薪未填写!'),
 	    	  new Array('expectSalaryend','期望年薪未填写!'),
 	    	  new Array('location','目前在所城市未选择!'),
 	    	  new Array('citySel','期望工作城市未选择!'),
 	    	  new Array('email','邮箱未填写!'),
 	    	  /* new Array('wechat','微信未填写!'), */
 	    	  /* new Array('qq','QQ未填写!'), */
 	    	  new Array('profession','专业未填写!'),
 	    	  /* new Array('linkedin','领英未填写!'), */
 	    	  new Array('tag','标签未选择!')
    	);
    	  for(var i=0;i<arr.length;i++){
        	  if($("#"+arr[i][0]).val()==''){
        		  $("#"+arr[i][0]).tips({
  					side:3,
  		            msg:arr[i][1],
  		            bg:'#AE81FF',
  		            time:1
  		        });
        		  $("#"+arr[i][0]).focus();
  				return;
  			}
    	};
        $("#signupForm").ajaxSubmit({
            url: '<%=contextPath%>/resume/update',
				type : 'post',
				dataType : "json",
				success : function(data) {
					if (data.code == 200) {
						swal({
							title : data.message,
							type : "success",
							showCancelButton : false,
							confirmButtonText : "确定",
							animation : "slide-from-bottom",
							closeOnConfirm : true
						}, function() {
							location.href = "<%=contextPath%>/resume/list?name="+name+"&phone="+phone;
						});
						$("#sub").attr("disabled","disabled");
					} else {
						swal("错误", data.message, "error");
					}
				}
			});
		});
    var areaid = '${resume.household}';
	$.ajax({//查询省
		url:"<%=contextPath%>/area/getAreaJson",
		data:{pid:0,level:1},
		type:"post",
		dataType:"json",
		success:function(data){
			var htm='';
			$("#province").append('<option value="">==请选择省直辖市==</option>');
			$("#prov").append('<option value="">==请选择省直辖市==</option>');
			$("#provnow").append('<option value="">==请选择省直辖市==</option>');
			$.each(data,function(i,item){
				$("#province").append("<option value='" + item.id + "'>" + item.name + "</option>");
				$("#prov").append("<option value='" + item.id + "'>" + item.name + "</option>");
				$("#provnow").append("<option value='" + item.id + "'>" + item.name + "</option>");
			});
			$('.selectpicker').selectpicker({  
			    'selectedText': 'cat'
			});
			$('.selectpicker').selectpicker('val', ${resume.natives});
		}
	});	
	$("#prov").change(function(){//查询市
		var pid = $(this).val();
		var city = $("#city");
		$("#city").show();
		if($("#city").children().length > 0) {
			city.empty();
		}
		$.ajax({//查询省
			url:"<%=contextPath%>/area/getAreaJson",
			data:{pid:pid,level:2},
			type:"post",
			dataType:"json",
			success:function(data){
				$("#city").append('<option value="">==请选择市州区==</option>');
				$.each(data,function(i,item){
					$("#city").append("<option value='" + item.id + "' >" + item.name + "</option>");
				});
			}
		})
	});
	$("#provnow").change(function(){//查询市
		var pid = $(this).val();
		var citynow = $("#citynow");
		$("#citynow").show();
		if($("#citynow").children().length > 0) {
			citynow.empty();
		}
		$.ajax({//查询省
			url:"<%=contextPath%>/area/getAreaJson",
			data:{pid:pid,level:2},
			type:"post",
			dataType:"json",
			success:function(data){
				$("#citynow").append('<option value="">==请选择市州区==</option>');
				$.each(data,function(i,item){
					$("#citynow").append("<option value='" + item.id + "'>" + item.name + "</option>");
				});
			}
		})
	});
})
    var tops ="${tops}";
    //分配资源
	function openTree(obj,num){
	     var ids = $("#"+obj+"Id").val();
	   	 var diag = new top.Dialog();
		 diag.Drag=true;
		 diag.Title ="请选择";
		 diag.URL = '<%=contextPath %>/'+obj+'/openZtree?ids='+ids+'&tops='+tops;
		 diag.Width = 250;
		 diag.Height = 400;
		 diag.CancelEvent = function(){ //关闭事件
			 var tempid = diag.innerFrame.contentWindow.document.getElementById('tempids').value;
			 var tempname = diag.innerFrame.contentWindow.document.getElementById('tempnames').value;
			if(tempid.length!==0){
				if(typeof(num)=="undefined"){ 
					$("#"+obj+"Id").val(tempid);
					$("#"+obj+"Name").val(tempname);
				}else{
					$("#"+obj+num+"Id").val(tempid);
					$("#"+obj+num+"Name").val(tempname);
				}
			}
			diag.close();
		 };
		 diag.show();
	}
	var id = $("#id").val();
	function addExperience(obj,num){
		 var ids = $("#"+obj+"Id").val();
	   	 var diag = new top.Dialog();
		 diag.Drag=true;
		 diag.Title ="请选择";
		 diag.URL = '<%=contextPath %>/'+obj+'/editView?talentsId='+id+'&num='+num+'&tops='+tops;
		 diag.Width = 950;
		 diag.Height = 750;
		 diag.CancelEvent = function(){ //关闭事件
			diag.close();
		 };
		 diag.show();
	}
    function initFileInput(ctrlName) {
        var control = $('#' + ctrlName);
        control.fileinput({
        language : 'zh',
        uploadUrl : "<%=contextPath%>/upload/insert",
        //autoReplace : true,
        //showUpload:false,
        overwriteInitial: false,
        showCaption: false,
        dropZoneEnabled: false,
        maxFileCount : 1,
        allowedFileExtensions : [ "jpg", "png", "gif" ],
        browseClass : "btn btn-primary", //按钮样式 
        previewFileIcon : "<i class='glyphicon glyphicon-king'></i>"
    }).on("fileuploaded", function(e, data) {
        var res = data.response;
        var num=1;
        $('#' + ctrlName+num).attr("value", res.success);
    })
    }
    $("#langtype").change(function() {
    	var tid = $(this).val();
    	var language = $("#langtype2");
		$("#langtype2").show();
		if($("#langtype2").children().length > 0) {
			language.empty();
		}
		$("#langtype2").append('<option value="">==请选择==</option>');
		if(tid ==1){
	    	$.ajax({
	    		url:'<%=contextPath%>/dictionarydata/getJsonByType',
	    		data:{types:'mandarin_value'},
	    		type:'post',
	    		success:function(data){
	    			$.each(data.list,function(i,item){
	    				$("#langtype2").append("<option value="+item.value+">"+item.valueName+"</option>");
	    			});
	    		}
	    	});
		}
		if(tid ==2){
	    	$.ajax({
	    		url:'<%=contextPath%>/dictionarydata/getJsonByType',
	    		data:{types:'english_value'},
	    		type:'post',
	    		success:function(data){
	    			$.each(data.list,function(i,item){
	    				$("#langtype2").append("<option value="+item.value+">"+item.valueName+"</option>");
	    			});
	    		}
	    	});
		}
	})
 //传入id和value判断是否存在 
    function verifyName(obj,value) {
        var temp = value.replace(/^\s+|\s+$/g, '');
    	if(obj.value!=""){
    		$.ajax({
    			url:'<%=contextPath%>/resume/isableName?'+obj+'='+temp,
    			type:'post',
    			dataType:'json',
    			success:function(data){
    				 if(data.code==400) {
    					swal({
          	    			title:data.message,
          	    			text: "1秒后自动关闭。", 
          	    			timer: 1000, 
          				    showConfirmButton: false
          	    		});
    					$("#"+obj).val("");
    				}
    			}
    		});	
    	}
    }
    function resumelist() {
    	location.href = "<%=contextPath%>/resume/list?name="+name+"&phone="+phone;
	}
</script>
</body>
</html>

